﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MeTalker.Aide.data;

namespace MeTalker.Aide.Forms
{
    internal partial class frmKeyword : MeForm
    {
        Node node;
        private frmKeyword()
        {
            InitializeComponent();
        }

        public frmKeyword(Node node)
            : this()
        {
            this.node = node;
            if (node != null) {
                txtMessage.Text = node.Text;
                txtKey1.Text = node.Keyword1;
                txtKey2.Text = node.Keyword2;
                txtKey3.Text = node.Keyword3;
                txtKey4.Text = node.Keyword4;
                txtKey5.Text = node.Keyword5;
                txtKey6.Text = node.Keyword6;
                txtKey7.Text = node.Keyword7;
                txtKey8.Text = node.Keyword8;
            }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            node.Keyword1 = txtKey1.Text;
            node.Keyword2 = txtKey2.Text;
            node.Keyword3 = txtKey3.Text;
            node.Keyword4 = txtKey4.Text;
            node.Keyword5 = txtKey5.Text;
            node.Keyword6 = txtKey6.Text;
            node.Keyword7 = txtKey7.Text;
            node.Keyword8 = txtKey8.Text;
            DialogResult = DialogResult.Yes;
            this.Close();
        }

        private void btnCancle_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.No;
            this.Close();
        }

        private void btnHelp_Click(object sender, EventArgs e)
        {
            UtilHelper.RunBrowser(UtilHelper.HELP_BASE_URL + "67.html");
        }
    }
}
